package com.zzty.txj.dao;


import com.zzty.txj.entity.DoDaily;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ReportMapper {
    @Select("select * from doDaily where userId=#{arg0} and date between #{arg1} and  #{arg2} ")
    public List<DoDaily> dodaily(Integer userId,String date1,String date2);
    @Select("select name from daily where id=#{id}")
    public String getSubjectName(Integer id);
    @Select("select name from user where id=#{id}")
    public String getName(Integer id);
    @Select("select result from doDaily where userId=#{arg0} and date between #{arg1} and  #{arg2} and dailyId=#{arg3}")
    public Integer count(Integer userId,String date1,String date2,Integer dailyId);
    @Select("select count(*) from doDaily where userId=#{arg0} and result=1 and date between #{arg1} and  #{arg2} and dailyId=#{arg3}")
    public Integer counts(Integer userId,String date1,String date2,Integer dailyId);
    @Select("select dailyId from userDaily where userId=#{userId}")
    public String dailyId(Integer userId);

}
